﻿using System.Xml.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Marbles.Core.Web.Cart
{
    [Serializable()]
    public class CartItem:ICartItem
    {
        public IProduct Product
        {
            get
            {
                return this._product;
            }
            set
            {
                this._product = value;
            }
        }

        public int Quantity
        {
            get
            {
                return this._quantity;
            }
            set
            {
                this._quantity = value; 
            }
        }


        [XmlIgnore()]
        public decimal Total
        {
            get { return (this.Product.Price * this.Quantity); }
        }

        private IProduct _product = null;
        private int _quantity = 0;

        public CartItem()
        {
            this._product = null;
            this._quantity = 0;
        }

        public CartItem(IProduct Product, int Quantity)
        {
            this._product = Product;
            this._quantity = Quantity;
        }
    }
}
